package com.v1.video.db.service;

import com.v1.video.AppContext;
import com.v1.video.db.dao.OperateTB;
import com.v1.video.db.dao.OperateTBDao;

public class OperateDB {

	private static OperateDB mInstance;
	private OperateTBDao mOperateTBDao;

	private OperateDB() {
		mOperateTBDao = AppContext.getDaoSession().getOperateTBDao();
	}

	public static OperateDB getInstance() {
		if (mInstance == null) {
			mInstance = new OperateDB();
		}
		return mInstance;
	}
	
	public void insert(OperateTB entity) {
		mOperateTBDao.insert(entity);
	}
	
	public long insert(String vid, String cid) {
		OperateTB entity = new OperateTB();
		entity.setVid(vid);
		entity.setCid(cid);
		entity.setFlag("1");
		return mOperateTBDao.insert(entity);
	}
	
	public void update(OperateTB entity) {
		mOperateTBDao.update(entity);
	}
}
